<script setup>
    defineProps(["data"])
    const emit = defineEmits(["delData"])
    function deleteData(item){
        emit("delData", item)
    }
</script>

<template>
    <div class="rsc">
       <table>
            <tr>
                <th>编号</th>
                <th>姓名</th>
                <th>年龄</th>
                <th>操作</th>
            </tr>
            <tr v-for="item in data" :key="item.sid">
                <td> {{ item.sid }}</td>
                <td> {{ item.name }}</td>
                <td> {{ item.age }}</td>
                <td>  <button @click="deleteData(item)">删除</button> </td>
            </tr>
       </table>
    </div>
</template>
